
<script type="text/javascript">
  function validateForm(form) {

    var filename=document.getElementById('form_batch_file_').value;
    var extension=filename.substr(filename.lastIndexOf('.')+1).toLowerCase();
    //alert(extension);
    if(extension=='csv') {
        return true;
    } else {
        alert('Please upload only .csv extention file.');
        return false;
    }

  }
</script>


<body>  
  
    <!--[if $smarty.request.available eq 'no']-->
      <div class="grid_23" style="font-size: x-large; color: red; text-align:center;">
           """""""""
          <br /><BR>
      </div><h1></h1>
    <!--[/if]-->
<BR>
  <CENTER><H2>อัพโหลด (CSV file)</H2>
      <form id="form" method=POST action="<!--[pnmodurl modname='VoteDataCenter' type='userform' func='submit' ctrl='File']-->" enctype="multipart/form-data" onSubmit="return validateForm(this)">
      <TABLE width="200" valign="middle" border="0" >
        <TR>
          <TD align="right" valign="middle"><input id="form_batch_file_" type="file" name="files" size="38"/>&nbsp;</TD>
        </TR>
        <TR>
          <TD align="center" valign="top"><!-- <input type="submit" value='Submit' name='Submit' type="submit" > &nbsp;<BR> --><INPUT type="image" name="Submit" src="modules/VoteDataCenter/pnimages/db_comit.gif" border="0" ><BR>Submit</TD>
        </TR>
        <TR>
          <TD align="center" valign="top">&nbsp;</TD>
        </TR>
      </TABLE>
      </form>
  </CENTER>

</body>